import { ref, type Ref } from 'vue';

export class BaseViewModel {
	loading : Ref<boolean> = ref(false);
	errorMsg : Ref<string> = ref('');

	showError(message : string) {
		this.errorMsg.value = message;
		uni.showToast({ title: message, icon: 'none' });
	}

	goTo(url : string) {
		uni.navigateTo({ url });
	}

	redirectTo(url : string) {
		uni.redirectTo({ url });
	}
}